Avoid conflicts with multiple helper classes from multiple assemblies#443
Avoid conflicts with multiple helper classes from multiple assemblies#443
Conversation
Since we were adding the EmbeddedResource helper as a global, project-wide class, if multiple projects happened to use resources, collisions would start to arise, with no way to disambiguate. Since the code in the helper is actually pretty straightforward and will very likely be inlined into the IL in the end anyway, we instead just add its code as part of the resource area being emitted itself. This might result in a slightly larger assembly if there are a ton of areas, but that's a somewhat unlikely scenario. Fixes #442
🧪 Details on Ubuntu 24.04.1 LTS✅ ThisAssemblyTests.ScribanTests.CanRenderModel 🧪 Details on macOS Unix 14.7.2✅ ThisAssemblyTests.ScribanTests.CanRenderModel 🧪 Details on Microsoft Windows 10.0.20348✅ ThisAssemblyTests.ScribanTests.CanRenderModel from dotnet-retest v0.6.3 on .NET 8.0.13 with 💜 |
Since we were adding the EmbeddedResource helper as a global, project-wide class, if multiple projects happened to use resources, collisions would start to arise, with no way to disambiguate.
Since the code in the helper is actually pretty straightforward and will very likely be inlined into the IL in the end anyway, we instead just add its code as part of the resource area being emitted itself. This might result in a slightly larger assembly if there are a ton of areas, but that's a somewhat unlikely scenario.
Fixes #442